package com.myf;

public class ApiResult {

    /// 是否执行成
    public boolean isSuccess;

    /// 返回数据
    public Object data;

    /// 错误编号
    public String errorCode;

    /// 错误提示
    public String errorMessage;

    public static ApiResult createSuccess(Object data) {
        var result = new ApiResult();
        result.isSuccess = true;
        result.data = data;
        return result;
    }

    public static ApiResult createError(String message)
    {
        var result = new ApiResult();
        result.isSuccess = false;
        result.errorMessage = message;
        return result;
    }
}
